<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="d1"></div>
<script>
    var timer;

    function showTime() {
        var now = new Date();
        var t1 = now.getTime();
        var enddate = new Date(2020, 5, 1, 0, 0, 0);
        var t2 = enddate.getTime();

        if (t2 - t1 < 0) {
            clearInterval(timer);
            d1.innerHTML = "祝大家劳动节快乐！";
            return;
        }
        var d = Math.floor((t2 - t1) / (1000 * 60 * 60 * 24));
        var h = Math.floor((t2 - t1) / (1000 * 60 * 60)) % 24;
        var m = Math.floor((t2 - t1) / (1000 * 60)) % 60;
        var s = Math.floor((t2 - t1) / (1000)) % 60;
        var sss = Math.floor((t2 - t1)) % 1000;
        if (h < 10) h = "0" + h;
        if (m < 10) m = "0" + m;
        if (s < 10) s = "0" + s;
        var timestr = d + "天" + h + ":" + m + ":" + s + " " + sss;
        d1.innerHTML = timestr;
    }

    showTime();
    timer = setInterval(showTime, 1);
</script>
</body>
</html>